using System;
using log4net;
using log4net.Config;

namespace Utility
{

    public class LoggingUtility
    {

        static LoggingUtility()
        {
            log4net.ILog[] ilogArr = log4net.LogManager.GetCurrentLoggers();
            bool flag = ilogArr.Length != 0;
            if (!flag)
                log4net.Config.XmlConfigurator.Configure();
        }

        private LoggingUtility()
        {
        }

        public static log4net.ILog GetLogger(System.Type type)
        {
            log4net.ILog ilog;

            bool flag = type != null;
            if (!flag)
                ilog = null;
            else
                ilog = LoggingUtility.GetLogger(type.FullName);
            return ilog;
        }

        public static log4net.ILog GetLogger(string loggerName)
        {
            bool flag = (loggerName != null) && (loggerName.Length >= 1);
            if (flag)
                goto label0;
            log4net.ILog ilog = null;
            label0:
            try
            {
                ilog = log4net.LogManager.GetLogger(loggerName);
            }
            catch (System.Exception e)
            {
                System.Console.WriteLine(e.Message);
                ilog = null;
            }
            return ilog;
        }

        public static bool logMethodEntry(log4net.ILog logger, string methodName)
        {
            bool flag1;

            bool flag2 = (logger == null) || (methodName == null);
            if (!flag2)
            {
                logger.Debug(methodName + " -----------  ENTRY  ----------- \uFFFD");
                flag1 = true;
            }
            else
            {
                flag1 = false;
            }
            return flag1;
        }

        public static bool logMethodExit(log4net.ILog log, string methodName)
        {
            bool flag1;

            bool flag2 = (log == null) || (methodName == null);
            if (!flag2)
            {
                log.Debug(methodName + " -----------  EXIT  ----------- \uFFFD");
                flag1 = true;
            }
            else
            {
                flag1 = false;
            }
            return flag1;
        }

    } 

}

